home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / Borland Visual dBASE Professiona v7.0 / DATA1.CAB / Sample_Include / Winbase.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-20  |  22.8 KB  |  690 lines

  1. //--------------------------------------------------------------
  2. //
  3. //  WINBASE.H 
  4. //
  5. //  This file contains Windows API type and constant
  6. //  declarations for calls to the Win32 API from Visual 
  7. //  dBASE. Function prototypes are in WIN32API.PRG.
  8. // 
  9. //  Visual dBASE Samples Group
  10. //
  11. //  $Revision:   1.2  $
  12. //
  13. //  Portions copyright (c) 1985-1995, Microsoft Corp. 
  14. //
  15. //--------------------------------------------------------------
  16.  
  17. #ifndef WIN32API_H
  18. #define WIN32API_H
  19.  
  20. #include <WINDEF.H>
  21.  
  22. #ifndef WIN32API_NOWINNT
  23. #include <WINNT.H>
  24. #endif
  25.  
  26. //------------------------------------------------------------------
  27. //
  28. //   winbase.h -- This module defines the 32-Bit Windows Base APIs
  29. //
  30. //   Copyright (c) 1990-1995, Microsoft Corp. All rights reserved.
  31. //
  32. //------------------------------------------------------------------
  33.  
  34. #define INVALID_HANDLE_VALUE (-1)
  35. #define INVALID_FILE_SIZE    0xFFFFFFFF
  36.  
  37. #define FILE_BEGIN           0
  38. #define FILE_CURRENT         1
  39. #define FILE_END             2
  40.  
  41. #define TIME_ZONE_ID_INVALID 0xFFFFFFFF
  42.  
  43. #define WAIT_FAILED          0xFFFFFFFF
  44. #define WAIT_OBJECT_0        ((STATUS_WAIT_0 ) + 0 )
  45.  
  46. #define WAIT_ABANDONED         ((STATUS_ABANDONED_WAIT_0 ) + 0 )
  47. #define WAIT_ABANDONED_0       ((STATUS_ABANDONED_WAIT_0 ) + 0 )
  48.  
  49. #define WAIT_TIMEOUT                        STATUS_TIMEOUT
  50. #define WAIT_IO_COMPLETION                  STATUS_USER_APC
  51. #define STILL_ACTIVE                        STATUS_PENDING
  52. #define EXCEPTION_ACCESS_VIOLATION          STATUS_ACCESS_VIOLATION
  53. #define EXCEPTION_DATATYPE_MISALIGNMENT     STATUS_DATATYPE_MISALIGNMENT
  54. #define EXCEPTION_BREAKPOINT                STATUS_BREAKPOINT
  55. #define EXCEPTION_SINGLE_STEP               STATUS_SINGLE_STEP
  56. #define EXCEPTION_ARRAY_BOUNDS_EXCEEDED     STATUS_ARRAY_BOUNDS_EXCEEDED
  57. #define EXCEPTION_FLT_DENORMAL_OPERAND      STATUS_FLOAT_DENORMAL_OPERAND
  58. #define EXCEPTION_FLT_DIVIDE_BY_ZERO        STATUS_FLOAT_DIVIDE_BY_ZERO
  59. #define EXCEPTION_FLT_INEXACT_RESULT        STATUS_FLOAT_INEXACT_RESULT
  60. #define EXCEPTION_FLT_INVALID_OPERATION     STATUS_FLOAT_INVALID_OPERATION
  61. #define EXCEPTION_FLT_OVERFLOW              STATUS_FLOAT_OVERFLOW
  62. #define EXCEPTION_FLT_STACK_CHECK           STATUS_FLOAT_STACK_CHECK
  63. #define EXCEPTION_FLT_UNDERFLOW             STATUS_FLOAT_UNDERFLOW
  64. #define EXCEPTION_INT_DIVIDE_BY_ZERO        STATUS_INTEGER_DIVIDE_BY_ZERO
  65. #define EXCEPTION_INT_OVERFLOW              STATUS_INTEGER_OVERFLOW
  66. #define EXCEPTION_PRIV_INSTRUCTION          STATUS_PRIVILEGED_INSTRUCTION
  67. #define EXCEPTION_IN_PAGE_ERROR             STATUS_IN_PAGE_ERROR
  68. #define EXCEPTION_ILLEGAL_INSTRUCTION       STATUS_ILLEGAL_INSTRUCTION
  69. #define EXCEPTION_NONCONTINUABLE_EXCEPTION  STATUS_NONCONTINUABLE_EXCEPTION
  70. #define EXCEPTION_STACK_OVERFLOW            STATUS_STACK_OVERFLOW
  71. #define EXCEPTION_INVALID_DISPOSITION       STATUS_INVALID_DISPOSITION
  72. #define EXCEPTION_GUARD_PAGE                STATUS_GUARD_PAGE_VIOLATION
  73. #define CONTROL_C_EXIT                      STATUS_CONTROL_C_EXIT
  74. #define MoveMemory RtlMoveMemory
  75. #define CopyMemory RtlCopyMemory
  76. #define FillMemory RtlFillMemory
  77. #define ZeroMemory RtlZeroMemory
  78.  
  79. //
  80. // File creation flags must start at the high end since they
  81. // are combined with the attributes
  82. //
  83.  
  84. #define FILE_FLAG_WRITE_THROUGH         0x80000000
  85. #define FILE_FLAG_OVERLAPPED            0x40000000
  86. #define FILE_FLAG_NO_BUFFERING          0x20000000
  87. #define FILE_FLAG_RANDOM_ACCESS         0x10000000
  88. #define FILE_FLAG_SEQUENTIAL_SCAN       0x08000000
  89. #define FILE_FLAG_DELETE_ON_CLOSE       0x04000000
  90. #define FILE_FLAG_BACKUP_SEMANTICS      0x02000000
  91. #define FILE_FLAG_POSIX_SEMANTICS       0x01000000
  92.  
  93. #define CREATE_NEW          1
  94. #define CREATE_ALWAYS       2
  95. #define OPEN_EXISTING       3
  96. #define OPEN_ALWAYS         4
  97. #define TRUNCATE_EXISTING   5
  98.  
  99. //
  100. // Define the Security Quality of Service bits to be passed
  101. // into CreateFile
  102. //
  103.  
  104. // These don't work too well since Visual dBASE is not case sensitive
  105. //#define SECURITY_ANONYMOUS          ( bitlshift(SecurityAnonymous,16 ))
  106. //#define SECURITY_IDENTIFICATION     ( bitlshift(SecurityIdentification, 16 ))
  107. //#define SECURITY_IMPERSONATION      ( bitlshift(SecurityImpersonation, 16 ))
  108. //#define SECURITY_DELEGATION         ( bitlshift(SecurityDelegation, 16 ))
  109.  
  110. #define SECURITY_CONTEXT_TRACKING  0x00040000
  111. #define SECURITY_EFFECTIVE_ONLY    0x00080000
  112.  
  113. #define SECURITY_SQOS_PRESENT      0x00100000
  114. #define SECURITY_VALID_SQOS_FLAGS  0x001F0000
  115.  
  116. #define MUTEX_MODIFY_STATE MUTANT_QUERY_STATE
  117. #define MUTEX_ALL_ACCESS   MUTANT_ALL_ACCESS
  118.  
  119. //
  120. // Serial provider type.
  121. //
  122.  
  123. #define SP_SERIALCOMM    (0x00000001)
  124.  
  125. //
  126. // Provider SubTypes
  127. //
  128.  
  129. #define PST_UNSPECIFIED      (0x00000000)
  130. #define PST_RS232            (0x00000001)
  131. #define PST_PARALLELPORT     (0x00000002)
  132. #define PST_RS422            (0x00000003)
  133. #define PST_RS423            (0x00000004)
  134. #define PST_RS449            (0x00000005)
  135. #define PST_MODEM            (0x00000006)
  136. #define PST_FAX              (0x00000021)
  137. #define PST_SCANNER          (0x00000022)
  138. #define PST_NETWORK_BRIDGE   (0x00000100)
  139. #define PST_LAT              (0x00000101)
  140. #define PST_TCPIP_TELNET     (0x00000102)
  141. #define PST_X25              (0x00000103)
  142.  
  143.  
  144. //
  145. // Provider capabilities flags.
  146. //
  147.  
  148. #define PCF_DTRDSR        (0x0001)
  149. #define PCF_RTSCTS        (0x0002)
  150. #define PCF_RLSD          (0x0004)
  151. #define PCF_PARITY_CHECK  (0x0008)
  152. #define PCF_XONXOFF       (0x0010)
  153. #define PCF_SETXCHAR      (0x0020)
  154. #define PCF_TOTALTIMEOUTS (0x0040)
  155. #define PCF_INTTIMEOUTS   (0x0080)
  156. #define PCF_SPECIALCHARS  (0x0100)
  157. #define PCF_16BITMODE     (0x0200)
  158.  
  159. //
  160. // Comm provider settable parameters.
  161. //
  162.  
  163. #define SP_PARITY         (0x0001)
  164. #define SP_BAUD           (0x0002)
  165. #define SP_DATABITS       (0x0004)
  166. #define SP_STOPBITS       (0x0008)
  167. #define SP_HANDSHAKING    (0x0010)
  168. #define SP_PARITY_CHECK   (0x0020)
  169. #define SP_RLSD           (0x0040)
  170.  
  171. //
  172. // Settable baud rates in the provider.
  173. //
  174.  
  175. #define BAUD_075          (0x00000001)
  176. #define BAUD_110          (0x00000002)
  177. #define BAUD_134_5        (0x00000004)
  178. #define BAUD_150          (0x00000008)
  179. #define BAUD_300          (0x00000010)
  180. #define BAUD_600          (0x00000020)
  181. #define BAUD_1200         (0x00000040)
  182. #define BAUD_1800         (0x00000080)
  183. #define BAUD_2400         (0x00000100)
  184. #define BAUD_4800         (0x00000200)
  185. #define BAUD_7200         (0x00000400)
  186. #define BAUD_9600         (0x00000800)
  187. #define BAUD_14400        (0x00001000)
  188. #define BAUD_19200        (0x00002000)
  189. #define BAUD_38400        (0x00004000)
  190. #define BAUD_56K          (0x00008000)
  191. #define BAUD_128K         (0x00010000)
  192. #define BAUD_115200       (0x00020000)
  193. #define BAUD_57600        (0x00040000)
  194. #define BAUD_USER         (0x10000000)
  195.  
  196. //
  197. // Settable Data Bits
  198. //
  199.  
  200. #define DATABITS_5        (0x0001)
  201. #define DATABITS_6        (0x0002)
  202. #define DATABITS_7        (0x0004)
  203. #define DATABITS_8        (0x0008)
  204. #define DATABITS_16       (0x0010)
  205. #define DATABITS_16X      (0x0020)
  206.  
  207. //
  208. // Settable Stop and Parity bits.
  209. //
  210.  
  211. #define STOPBITS_10       (0x0001)
  212. #define STOPBITS_15       (0x0002)
  213. #define STOPBITS_20       (0x0004)
  214. #define PARITY_NONE       (0x0100)
  215. #define PARITY_ODD        (0x0200)
  216. #define PARITY_EVEN       (0x0400)
  217. #define PARITY_MARK       (0x0800)
  218. #define PARITY_SPACE      (0x1000)
  219.  
  220. //
  221. // Set dwProvSpec1 to COMMPROP_INITIALIZED to indicate that wPacketLength
  222. // is valid before a call to GetCommProperties().
  223. //
  224. #define COMMPROP_INITIALIZED (0xE73CF52E)
  225.  
  226. //
  227. // DTR Control Flow Values.
  228. //
  229. #define DTR_CONTROL_DISABLE    0x00
  230. #define DTR_CONTROL_ENABLE     0x01
  231. #define DTR_CONTROL_HANDSHAKE  0x02
  232.  
  233. //
  234. // RTS Control Flow Values
  235. //
  236. #define RTS_CONTROL_DISABLE    0x00
  237. #define RTS_CONTROL_ENABLE     0x01
  238. #define RTS_CONTROL_HANDSHAKE  0x02
  239. #define RTS_CONTROL_TOGGLE     0x03
  240.  
  241. // Global Memory Flags 
  242. #define GMEM_FIXED          0x0000
  243. #define GMEM_MOVEABLE       0x0002
  244. #define GMEM_NOCOMPACT      0x0010
  245. #define GMEM_NODISCARD      0x0020
  246. #define GMEM_ZEROINIT       0x0040
  247. #define GMEM_MODIFY         0x0080
  248. #define GMEM_DISCARDABLE    0x0100
  249. #define GMEM_NOT_BANKED     0x1000
  250. #define GMEM_SHARE          0x2000
  251. #define GMEM_DDESHARE       0x2000
  252. #define GMEM_NOTIFY         0x4000
  253. #define GMEM_LOWER          GMEM_NOT_BANKED
  254. #define GMEM_VALID_FLAGS    0x7F72
  255. #define GMEM_INVALID_HANDLE 0x8000
  256.  
  257. #define GHND                (bitor(GMEM_MOVEABLE, GMEM_ZEROINIT))
  258. #define GPTR                (bitor(GMEM_FIXED, GMEM_ZEROINIT))
  259.  
  260. // Flags returned by GlobalFlags (in addition to GMEM_DISCARDABLE) 
  261. #define GMEM_DISCARDED      0x4000
  262. #define GMEM_LOCKCOUNT      0x00FF
  263.  
  264. // Local Memory Flags 
  265. #define LMEM_FIXED          0x0000
  266. #define LMEM_MOVEABLE       0x0002
  267. #define LMEM_NOCOMPACT      0x0010
  268. #define LMEM_NODISCARD      0x0020
  269. #define LMEM_ZEROINIT       0x0040
  270. #define LMEM_MODIFY         0x0080
  271. #define LMEM_DISCARDABLE    0x0F00
  272. #define LMEM_VALID_FLAGS    0x0F72
  273. #define LMEM_INVALID_HANDLE 0x8000
  274.  
  275. #define LHND                (bitor(LMEM_MOVEABLE, LMEM_ZEROINIT))
  276. #define LPTR                (bitor(LMEM_FIXED, LMEM_ZEROINIT))
  277.  
  278. #define NONZEROLHND         (LMEM_MOVEABLE)
  279. #define NONZEROLPTR         (LMEM_FIXED)
  280.  
  281. // Flags returned by LocalFlags (in addition to LMEM_DISCARDABLE) 
  282. #define LMEM_DISCARDED      0x4000
  283. #define LMEM_LOCKCOUNT      0x00FF
  284.  
  285. //
  286. // dwCreationFlag values
  287. //
  288.  
  289. #define DEBUG_PROCESS               0x00000001
  290. #define DEBUG_ONLY_THIS_PROCESS     0x00000002
  291.  
  292. #define CREATE_SUSPENDED            0x00000004
  293.  
  294. #define DETACHED_PROCESS            0x00000008
  295.  
  296. #define CREATE_NEW_CONSOLE          0x00000010
  297.  
  298. #define NORMAL_PRIORITY_CLASS       0x00000020
  299. #define IDLE_PRIORITY_CLASS         0x00000040
  300. #define HIGH_PRIORITY_CLASS         0x00000080
  301. #define REALTIME_PRIORITY_CLASS     0x00000100
  302.  
  303. #define CREATE_NEW_PROCESS_GROUP    0x00000200
  304. #define CREATE_UNICODE_ENVIRONMENT  0x00000400
  305.  
  306. #define CREATE_SEPARATE_WOW_VDM     0x00000800
  307. #define CREATE_SHARED_WOW_VDM       0x00001000
  308.  
  309. #define CREATE_DEFAULT_ERROR_MODE   0x04000000
  310. #define CREATE_NO_WINDOW            0x08000000
  311.  
  312. #define PROFILE_USER                0x10000000
  313. #define PROFILE_KERNEL              0x20000000
  314. #define PROFILE_SERVER              0x40000000
  315.  
  316. #define THREAD_PRIORITY_LOWEST          THREAD_BASE_PRIORITY_MIN
  317. #define THREAD_PRIORITY_BELOW_NORMAL    (THREAD_PRIORITY_LOWEST+1)
  318. #define THREAD_PRIORITY_NORMAL          0
  319. #define THREAD_PRIORITY_HIGHEST         THREAD_BASE_PRIORITY_MAX
  320. #define THREAD_PRIORITY_ABOVE_NORMAL    (THREAD_PRIORITY_HIGHEST-1)
  321. #define THREAD_PRIORITY_ERROR_RETURN    (MAXLONG)
  322.  
  323. #define THREAD_PRIORITY_TIME_CRITICAL   THREAD_BASE_PRIORITY_LOWRT
  324. #define THREAD_PRIORITY_IDLE            THREAD_BASE_PRIORITY_IDLE
  325.  
  326. //
  327. // Debug APIs
  328. //
  329. #define EXCEPTION_DEBUG_EVENT       1
  330. #define CREATE_THREAD_DEBUG_EVENT   2
  331. #define CREATE_PROCESS_DEBUG_EVENT  3
  332. #define EXIT_THREAD_DEBUG_EVENT     4
  333. #define EXIT_PROCESS_DEBUG_EVENT    5
  334. #define LOAD_DLL_DEBUG_EVENT        6
  335. #define UNLOAD_DLL_DEBUG_EVENT      7
  336. #define OUTPUT_DEBUG_STRING_EVENT   8
  337. #define RIP_EVENT                   9
  338.  
  339. #define DRIVE_UNKNOWN     0
  340. #define DRIVE_NO_ROOT_DIR 1
  341. #define DRIVE_REMOVABLE   2
  342. #define DRIVE_FIXED       3
  343. #define DRIVE_REMOTE      4
  344. #define DRIVE_CDROM       5
  345. #define DRIVE_RAMDISK     6
  346.  
  347. #define FILE_TYPE_UNKNOWN   0x0000
  348. #define FILE_TYPE_DISK      0x0001
  349. #define FILE_TYPE_CHAR      0x0002
  350. #define FILE_TYPE_PIPE      0x0003
  351. #define FILE_TYPE_REMOTE    0x8000
  352.  
  353. #define STD_INPUT_HANDLE    -10
  354. #define STD_OUTPUT_HANDLE   -11
  355. #define STD_ERROR_HANDLE      -12
  356.  
  357. #define NOPARITY            0
  358. #define ODDPARITY           1
  359. #define EVENPARITY          2
  360. #define MARKPARITY          3
  361. #define SPACEPARITY         4
  362.  
  363. #define ONESTOPBIT          0
  364. #define ONE5STOPBITS        1
  365. #define TWOSTOPBITS         2
  366.  
  367. #define IGNORE              0       // Ignore signal
  368. #define INFINITE            0xFFFFFFFF  // Infinite timeout
  369.  
  370. //
  371. // Basud rates at which the communication device operates
  372. //
  373.  
  374. #define CBR_110             110
  375. #define CBR_300             300
  376. #define CBR_600             600
  377. #define CBR_1200            1200
  378. #define CBR_2400            2400
  379. #define CBR_4800            4800
  380. #define CBR_9600            9600
  381. #define CBR_14400           14400
  382. #define CBR_19200           19200
  383. #define CBR_38400           38400
  384. #define CBR_56000           56000
  385. #define CBR_57600           57600
  386. #define CBR_115200          115200
  387. #define CBR_128000          128000
  388. #define CBR_256000          256000
  389.  
  390. //
  391. // Error Flags
  392. //
  393.  
  394. #define CE_RXOVER           0x0001  // Receive Queue overflow
  395. #define CE_OVERRUN          0x0002  // Receive Overrun Error
  396. #define CE_RXPARITY         0x0004  // Receive Parity Error
  397. #define CE_FRAME            0x0008  // Receive Framing error
  398. #define CE_BREAK            0x0010  // Break Detected
  399. #define CE_TXFULL           0x0100  // TX Queue is full
  400. #define CE_PTO              0x0200  // LPTx Timeout
  401. #define CE_IOE              0x0400  // LPTx I/O Error
  402. #define CE_DNS              0x0800  // LPTx Device not selected
  403. #define CE_OOP              0x1000  // LPTx Out-Of-Paper
  404. #define CE_MODE             0x8000  // Requested mode unsupported
  405.  
  406. #define IE_BADID            (-1)    // Invalid or unsupported id
  407. #define IE_OPEN             (-2)    // Device Already Open
  408. #define IE_NOPEN            (-3)    // Device Not Open
  409. #define IE_MEMORY           (-4)    // Unable to allocate queues
  410. #define IE_DEFAULT          (-5)    // Error in default parameters
  411. #define IE_HARDWARE         (-10)   // Hardware Not Present
  412. #define IE_BYTESIZE         (-11)   // Illegal Byte Size
  413. #define IE_BAUDRATE         (-12)   // Unsupported BaudRate
  414.  
  415. //
  416. // Events
  417. //
  418.  
  419. #define EV_RXCHAR           0x0001  // Any Character received
  420. #define EV_RXFLAG           0x0002  // Received certain character
  421. #define EV_TXEMPTY          0x0004  // Transmitt Queue Empty
  422. #define EV_CTS              0x0008  // CTS changed state
  423. #define EV_DSR              0x0010  // DSR changed state
  424. #define EV_RLSD             0x0020  // RLSD changed state
  425. #define EV_BREAK            0x0040  // BREAK received
  426. #define EV_ERR              0x0080  // Line status error occurred
  427. #define EV_RING             0x0100  // Ring signal detected
  428. #define EV_PERR             0x0200  // Printer error occured
  429. #define EV_RX80FULL         0x0400  // Receive buffer is 80 percent full
  430. #define EV_EVENT1           0x0800  // Provider specific event 1
  431. #define EV_EVENT2           0x1000  // Provider specific event 2
  432.  
  433. //
  434. // Escape Functions
  435. //
  436.  
  437. #define SETXOFF             1       // Simulate XOFF received
  438. #define SETXON              2       // Simulate XON received
  439. #define SETRTS              3       // Set RTS high
  440. #define CLRRTS              4       // Set RTS low
  441. #define SETDTR              5       // Set DTR high
  442. #define CLRDTR              6       // Set DTR low
  443. #define RESETDEV            7       // Reset device if possible
  444. #define SETBREAK            8       // Set the device break line.
  445. #define CLRBREAK            9       // Clear the device break line.
  446.  
  447. //
  448. // PURGE function flags.
  449. //
  450. #define PURGE_TXABORT       0x0001  // Kill the pending/current writes to the comm port.
  451. #define PURGE_RXABORT       0x0002  // Kill the pending/current reads to the comm port.
  452. #define PURGE_TXCLEAR       0x0004  // Kill the transmit queue if there.
  453. #define PURGE_RXCLEAR       0x0008  // Kill the typeahead buffer if there.
  454.  
  455. #define LPTx                0x80    // Set if ID is for LPT device
  456.  
  457. //
  458. // Modem Status Flags
  459. //
  460. #define MS_CTS_ON           (0x0010)
  461. #define MS_DSR_ON           (0x0020)
  462. #define MS_RING_ON          (0x0040)
  463. #define MS_RLSD_ON          (0x0080)
  464.  
  465. //
  466. // WaitSoundState() Constants
  467. //
  468.  
  469. #define S_QUEUEEMPTY        0
  470. #define S_THRESHOLD         1
  471. #define S_ALLTHRESHOLD      2
  472.  
  473. //
  474. // Accent Modes
  475. //
  476.  
  477. #define S_NORMAL      0
  478. #define S_LEGATO      1
  479. #define S_STACCATO    2
  480.  
  481. //
  482. // SetSoundNoise() Sources
  483. //
  484.  
  485. #define S_PERIOD512   0     // Freq = N/512 high pitch, less coarse hiss
  486. #define S_PERIOD1024  1     // Freq = N/1024
  487. #define S_PERIOD2048  2     // Freq = N/2048 low pitch, more coarse hiss
  488. #define S_PERIODVOICE 3     // Source is frequency from voice channel (3)
  489. #define S_WHITE512    4     // Freq = N/512 high pitch, less coarse hiss
  490. #define S_WHITE1024   5     // Freq = N/1024
  491. #define S_WHITE2048   6     // Freq = N/2048 low pitch, more coarse hiss
  492. #define S_WHITEVOICE  7     // Source is frequency from voice channel (3)
  493.  
  494. #define S_SERDVNA     (-1)  // Device not available
  495. #define S_SEROFM      (-2)  // Out of memory
  496. #define S_SERMACT     (-3)  // Music active
  497. #define S_SERQFUL     (-4)  // Queue full
  498. #define S_SERBDNT     (-5)  // Invalid note
  499. #define S_SERDLN      (-6)  // Invalid note length
  500. #define S_SERDCC      (-7)  // Invalid note count
  501. #define S_SERDTP      (-8)  // Invalid tempo
  502. #define S_SERDVL      (-9)  // Invalid volume
  503. #define S_SERDMD      (-10) // Invalid mode
  504. #define S_SERDSH      (-11) // Invalid shape
  505. #define S_SERDPT      (-12) // Invalid pitch
  506. #define S_SERDFQ      (-13) // Invalid frequency
  507. #define S_SERDDR      (-14) // Invalid duration
  508. #define S_SERDSR      (-15) // Invalid source
  509. #define S_SERDST      (-16) // Invalid state
  510.  
  511. #define NMPWAIT_WAIT_FOREVER            0xffffffff
  512. #define NMPWAIT_NOWAIT                  0x00000001
  513. #define NMPWAIT_USE_DEFAULT_WAIT        0x00000000
  514.  
  515. #define FS_CASE_IS_PRESERVED            FILE_CASE_PRESERVED_NAMES
  516. #define FS_CASE_SENSITIVE               FILE_CASE_SENSITIVE_SEARCH
  517. #define FS_UNICODE_STORED_ON_DISK       FILE_UNICODE_ON_DISK
  518. #define FS_PERSISTENT_ACLS              FILE_PERSISTENT_ACLS
  519. #define FS_VOL_IS_COMPRESSED            FILE_VOLUME_IS_COMPRESSED
  520. #define FS_FILE_COMPRESSION             FILE_FILE_COMPRESSION
  521.  
  522. #define FILE_MAP_COPY       SECTION_QUERY
  523. #define FILE_MAP_WRITE      SECTION_MAP_WRITE
  524. #define FILE_MAP_READ       SECTION_MAP_READ
  525. #define FILE_MAP_ALL_ACCESS SECTION_ALL_ACCESS
  526.  
  527. #define OF_READ             0x00000000
  528. #define OF_WRITE            0x00000001
  529. #define OF_READWRITE        0x00000002
  530. #define OF_SHARE_COMPAT     0x00000000
  531. #define OF_SHARE_EXCLUSIVE  0x00000010
  532. #define OF_SHARE_DENY_WRITE 0x00000020
  533. #define OF_SHARE_DENY_READ  0x00000030
  534. #define OF_SHARE_DENY_NONE  0x00000040
  535. #define OF_PARSE            0x00000100
  536. #define OF_DELETE           0x00000200
  537. #define OF_VERIFY           0x00000400
  538. #define OF_CANCEL           0x00000800
  539. #define OF_CREATE           0x00001000
  540. #define OF_PROMPT           0x00002000
  541. #define OF_EXIST            0x00004000
  542. #define OF_REOPEN           0x00008000
  543.  
  544. #define OFS_MAXPATHNAME 128
  545.  
  546. #define MAXINTATOM      0xC000
  547. #define MAKEINTATOM(i)  (i)
  548. #define INVALID_ATOM    (0)
  549.  
  550. #define PROCESS_HEAP_REGION             0x0001
  551. #define PROCESS_HEAP_UNCOMMITTED_RANGE  0x0002
  552. #define PROCESS_HEAP_ENTRY_BUSY         0x0004
  553. #define PROCESS_HEAP_ENTRY_MOVEABLE     0x0010
  554. #define PROCESS_HEAP_ENTRY_DDESHARE     0x0020
  555.  
  556. // GetBinaryType return values.
  557.  
  558. #define SCS_32BIT_BINARY    0
  559. #define SCS_DOS_BINARY      1
  560. #define SCS_WOW_BINARY      2
  561. #define SCS_PIF_BINARY      3
  562. #define SCS_POSIX_BINARY    4
  563. #define SCS_OS216_BINARY    5
  564.  
  565. #define SEM_FAILCRITICALERRORS      0x0001
  566. #define SEM_NOGPFAULTERRORBOX       0x0002
  567. #define SEM_NOALIGNMENTFAULTEXCEPT  0x0004
  568. #define SEM_NOOPENFILEERRORBOX      0x8000
  569.  
  570. #define LOCKFILE_FAIL_IMMEDIATELY   0x00000001
  571. #define LOCKFILE_EXCLUSIVE_LOCK     0x00000002
  572.  
  573. #define HANDLE_FLAG_INHERIT             0x00000001
  574. #define HANDLE_FLAG_PROTECT_FROM_CLOSE  0x00000002
  575.  
  576. #define HINSTANCE_ERROR 32
  577.  
  578. #define GET_TAPE_MEDIA_INFORMATION 0
  579. #define GET_TAPE_DRIVE_INFORMATION 1
  580.  
  581. #define SET_TAPE_MEDIA_INFORMATION 0
  582. #define SET_TAPE_DRIVE_INFORMATION 1
  583.  
  584. #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100
  585. #define FORMAT_MESSAGE_IGNORE_INSERTS  0x00000200
  586. #define FORMAT_MESSAGE_FROM_STRING     0x00000400
  587. #define FORMAT_MESSAGE_FROM_HMODULE    0x00000800
  588. #define FORMAT_MESSAGE_FROM_SYSTEM     0x00001000
  589. #define FORMAT_MESSAGE_ARGUMENT_ARRAY  0x00002000
  590. #define FORMAT_MESSAGE_MAX_WIDTH_MASK  0x000000FF
  591.  
  592. #define TLS_OUT_OF_INDEXES 0xFFFFFFFF
  593.  
  594. //
  595. //  Stream Ids
  596. //
  597.  
  598. #define BACKUP_INVALID          0x00000000
  599. #define BACKUP_DATA             0x00000001
  600. #define BACKUP_EA_DATA          0x00000002
  601. #define BACKUP_SECURITY_DATA    0x00000003
  602. #define BACKUP_ALTERNATE_DATA   0x00000004
  603. #define BACKUP_LINK             0x00000005
  604. #define BACKUP_PROPERTY_DATA    0x00000006
  605.  
  606. //
  607. //  Stream Attributes
  608. //
  609.  
  610. #define STREAM_NORMAL_ATTRIBUTE         0x00000000
  611. #define STREAM_MODIFIED_WHEN_READ       0x00000001
  612. #define STREAM_CONTAINS_SECURITY        0x00000002
  613. #define STREAM_CONTAINS_PROPERTIES      0x00000004
  614.  
  615. //
  616. // Dual Mode API below this line. Dual Mode Structures also included.
  617. //
  618.  
  619. #define STARTF_USESHOWWINDOW    0x00000001
  620. #define STARTF_USESIZE          0x00000002
  621. #define STARTF_USEPOSITION      0x00000004
  622. #define STARTF_USECOUNTCHARS    0x00000008
  623. #define STARTF_USEFILLATTRIBUTE 0x00000010
  624. #define STARTF_RUNFULLSCREEN    0x00000020  // ignored for non-x86 platforms
  625. #define STARTF_FORCEONFEEDBACK  0x00000040
  626. #define STARTF_FORCEOFFFEEDBACK 0x00000080
  627. #define STARTF_USESTDHANDLES    0x00000100
  628. #define STARTF_USEHOTKEY        0x00000200
  629.  
  630. #define SHUTDOWN_NORETRY                0x00000001
  631.  
  632. #define DONT_RESOLVE_DLL_REFERENCES     0x00000001
  633. #define LOAD_LIBRARY_AS_DATAFILE        0x00000002
  634. #define LOAD_WITH_ALTERED_SEARCH_PATH   0x00000008
  635.  
  636. #define ENUMRESTYPEPROC   FARPROC
  637. #define ENUMRESNAMEPROC   FARPROC
  638. #define ENUMRESLANGPROC   FARPROC
  639.  
  640. #define DDD_RAW_TARGET_PATH         0x00000001
  641. #define DDD_REMOVE_DEFINITION       0x00000002
  642. #define DDD_EXACT_MATCH_ON_REMOVE   0x00000004
  643.  
  644. #define MOVEFILE_REPLACE_EXISTING   0x00000001
  645. #define MOVEFILE_COPY_ALLOWED       0x00000002
  646. #define MOVEFILE_DELAY_UNTIL_REBOOT 0x00000004
  647.  
  648. #define LOGON32_LOGON_INTERACTIVE   2
  649. #define LOGON32_LOGON_BATCH         4
  650. #define LOGON32_LOGON_SERVICE       5
  651.  
  652. #define LOGON32_PROVIDER_DEFAULT    0
  653. #define LOGON32_PROVIDER_WINNT35    1
  654.  
  655. //
  656. // dwPlatformId defines:
  657. //
  658. #define VER_PLATFORM_WIN32s             0
  659. #define VER_PLATFORM_WIN32_WINDOWS      1
  660. #define VER_PLATFORM_WIN32_NT           2
  661.  
  662. // Abnormal termination codes 
  663.  
  664. #define TC_NORMAL       0
  665. #define TC_HARDERR      1
  666. #define TC_GP_TRAP      2
  667. #define TC_SIGNAL       3
  668.  
  669. //
  670. // Power Management APIs
  671. //
  672.  
  673. #define AC_LINE_OFFLINE                 0x00
  674. #define AC_LINE_ONLINE                  0x01
  675. #define AC_LINE_BACKUP_POWER            0x02
  676. #define AC_LINE_UNKNOWN                 0xFF
  677.  
  678. #define BATTERY_FLAG_HIGH               0x01
  679. #define BATTERY_FLAG_LOW                0x02
  680. #define BATTERY_FLAG_CRITICAL           0x04
  681. #define BATTERY_FLAG_CHARGING           0x08
  682. #define BATTERY_FLAG_NO_BATTERY         0x80
  683. #define BATTERY_FLAG_UNKNOWN            0xFF
  684.  
  685. #define BATTERY_PERCENTAGE_UNKNOWN      0xFF
  686.  
  687. #define BATTERY_LIFE_UNKNOWN        0xFFFFFFFF
  688.  
  689. #endif  // WINBASE_H
  690.